package panel.home.downBtns
{
	import assists.SizeManager;
	
	import flash.display.Bitmap;
	import flash.display.Sprite;
	
	import panel.home.fastBtn.FastBtnBase;
	
	public class DownBtnBase extends FastBtnBase
	{
	    protected var _backLayer:Sprite = new Sprite();
		public function DownBtnBase()
		{
			super();
			_backLayer.mouseEnabled = false;
			this.addChildAt(_backLayer,0);
		}
		
		override protected function resize():void
		{
			_txtBack.visible = false;
			_nameTxt.x = (_bitmap.width - _nameTxt.width) / 2;
			_nameTxt.y = _bitmap.height - _bitmap.height / 20;
		}
		
		override public function scale():void
		{
			_bitmap.scaleX = _bitmap.scaleY = SizeManager.fromeNumToscale(5,_bitmap.width * 1.2);
			resize();
		}
		
		
		public function changeChooseState(backGround:Bitmap,isShow:Boolean):void
		{
			if(isShow)
			{
				_backLayer.addChild(backGround);
				backGround.x = (_bitmap.width - backGround.width)/2;
				backGround.y = (_bitmap.height - backGround.height)/2;
				
			}else
			{
				_backLayer.removeChild(backGround);
			}
		}
		
	}
}